package mud.unit;

import mud.Exit;

/** Action in which a unit moves through an exit */
public class MoveAction extends Action {

    /** the exit that the unit is taking */
    private final Character unit;
    
    /** the exit that the unit is taking */
    private final Exit exit;

    /**
     * Constructs a new MoveAction
     * @param unit the unit that is moving
     * @param exit the exit that the unit is taking
     */
    public MoveAction(Character unit, Exit exit) {
        super(true);
        this.unit = unit;
        this.exit = exit;
    }

    @Override
    public void perform() {
        unit.exit(exit);
    }

}
